<%--
  Created by IntelliJ IDEA.
  User: 13656
  Date: 2021/6/22
  Time: 23:51
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <script src="./js/jquery.min.js"></script>
    <script src="./js/bootstrap.js"></script>
    <link rel="stylesheet" href="./css/bootstrap.min.css">
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/index.css">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>花礼网</title>

    <script>
        $(function (){
            $.ajax({
                url:"${pageContext.request.contextPath}/goodstypejson",
                Method:"get",
                success:function (list) {
                    var s="";
                    // list[0]
                    for (var i=0;i<list.length;i++){
                        s+='<li><a href="${pageContext.request.contextPath}/getGoodsListByTn?tn='+list[i].name+'" target="_self">'+list[i].name+'</a></li>';
                    }
                    $("#menu ul").html(s);
                }
            })
        })
    </script>

</head>
<body>
<div class="headercol">
    <nav class="navbar navbar-default container">
        <div class="navbar-header navbar-left">
            <button class="navbar navbar-toggle" type="button" data-target="#menu" data-toggle="collapse" aria-expanded="false">
                <span class="sr-only">汉堡按钮</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a href="index.jsp" class="" id="nav-brand-itheima">
                <img src="assets/flowerlogoo.jpg" alt="">
            </a>
        </div>

        <div id="menu" class="collapse navbar-collapse navbar-nav">
            <ul class="nav navbar-nav">
            </ul>
        </div>
    </nav>
    <!-- 搜索+购物车登录注册start -->
    <div class="container" >
        <form role="form" class="form-horizontal">
            <div class="form-group">
                <div class="">
                    <!-- 搜索 -->
                    <div class="input-group col-xs-12 col-sm-12 col-md-6 col-lg-7 " style="float: left;">
                        <input type="text" class="form-control" placeholder="请输入内容">
                        <span class="input-group-btn">
                                <input type="submit" class="btn btn-danger" value="搜索">
                            </span>
                    </div>
                    <div class="col-md-1"></div>
                    <!-- 购物车登录注册 -->
                    <div class="fr col-xs-12 col-sm-12 col-md-5 col-lg-4">
                        <ul>
                            <li><a href="${pageContext.request.contextPath}/getCart" target="_self">购物车</a>&nbsp;</li>
                            <li></li>
                            <li><a href="register.jsp">注册</a>&nbsp;</li>
                            <li></li>
                            <c:if test="${empty user}">
                                <li><a href="login.jsp">请登录</a> &nbsp;</li>
                            </c:if>
                            <c:if test="${not empty user}">
                                <li><a href="my.jsp">你好，${user.username}</a> &nbsp;</li>
                                <li></li>
                                <li><a href="userloginout">注销</a> &nbsp;</li>
                            </c:if>

                        </ul>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <!-- 搜索+购物车登录注册start -->
</div>
</body>
</html>
